package pt.nmfa.peste.session;

import pt.nmfa.peste.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("deviceActionsList")
public class DeviceActionsList extends EntityQuery<DeviceActions> {

	private static final String EJBQL = "select deviceActions from DeviceActions deviceActions";

	private static final String[] RESTRICTIONS = {
			"lower(deviceActions.actionType) like lower(concat(#{deviceActionsList.deviceActions.actionType},'%'))",
			"lower(deviceActions.name) like lower(concat(#{deviceActionsList.deviceActions.name},'%'))", };

	private DeviceActions deviceActions = new DeviceActions();

	public DeviceActionsList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public DeviceActions getDeviceActions() {
		return deviceActions;
	}
}
